package com.wn.cloud.common.response;

import com.wn.cloud.common.constant.ResponseEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @FileName: CommonResult
 * @Description: TODO
 * @Author: MaWenHao
 * @Created: 2020/3/8 - 0:34
 * @Version: V1.0
 * @Company: 东方微银科技（北京）有限公司
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CommonResult implements Serializable {

    private int code;

    private String message;

    public static CommonResult genMessageResult(ResponseEnum responseEnum) {
        return new CommonResult(responseEnum.getCode(), responseEnum.getMessage());
    }
}
